/*
Copyright (c) 2010 Andreas Bjerkeholt
License: MIT
http://www.opensource.org/licenses/mit-license.php
*/
#ifndef __graphics_sml_h__
#define __graphics_sml_h__

#include "graphics.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>

#include <sml/graphics.h>
#include <sml/sprite.h>

#define imageWidth(x) x->width
#define imageHeight(x) x->height

extern display* gameDisplay;

extern gfx_font* gameFont;
extern gfx_font* gameFontYellow;
extern gfx_font* gameFontGrey;
extern gfx_font* gameFontBlack;

extern sprite* gameTiles;

extern gfx_texture* gameSplash;
extern gfx_texture* menuBg;
extern sprite* hudSmallKeyRed;
extern sprite* hudSmallKeyBlue;
extern sprite* hudSmallKeyGreen;
extern sprite* hudSmallKeyYellow;
extern sprite* hudFireBootsSmall;
extern sprite* hudFlippersSmall;
extern sprite* hudSkatesSmall;
extern sprite* hudSuctionBootsSmall;
extern sprite* checkmark;
extern sprite* yellowArrow;

bool initGfx();
void termGfx();
void drawText(int x, int y, gfx_font* font, char* text);
void drawChar(int x, int y, gfx_font* font, char c);
void drawTextCenter(int y, gfx_font* font, char* text);
void drawTexture(int x, int y, gfx_texture* tex);
void drawSprite(int x, int y, sprite* sprite);
void drawTileGfx(int x, int y, uint8_t tileNo);
void drawRect(int x, int y, int w, int h, gfx_color color);
void drawRectFill(int x, int y, int w, int h, gfx_color color);
void drawLine(int x1, int y1, int x2, int y2, gfx_color color);
void clearScreen(gfx_color inColor);
void flipDisplay();
void fadeScreen(int8_t percent);
bool loadFirstGfx(); // Splash, base font
bool loadGfx(); // The rest
void unloadGfx();

#endif
